package main

import (
	"fmt"
	"os"
)

//  go run .\05_获取文件属性.go D:\go_projects\go_project1\笔记\作用域.md
func main() {
	list := os.Args

	//fmt.Println("list: ", list)

	if len(list) != 2 {
		fmt.Println("usage: xxx file")
		return
	}

	fileName := list[1]

	fileInfo, err := os.Stat(fileName)
	if err != nil {
		fmt.Println("fileInfo err： ", err)
		return
	}

	fmt.Println("name: ", fileInfo.Name(), " size: ", fileInfo.Size())
}
